const { createProxyMiddleware } = require('http-proxy-middleware')

module.exports = function (app) {
  // 登录 
  app.use(createProxyMiddleware('/api', {
    target: 'http://192.168.2.185:44000',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/api": ""
    }
  }))
  app.use(createProxyMiddleware('/loupan', {
    target: 'http://192.168.2.153:8080',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/loupan": ""
    }
  }))
  app.use(createProxyMiddleware('/dongtai', {
    target: 'http://192.168.2.153:8089',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/dongtai": ""
    }
  }))
  app.use(createProxyMiddleware('/shop', {
    target: 'http://192.168.2.182:10001/multihouse',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/shop": ""
    }
  }))
  app.use(createProxyMiddleware('/home_list', {
    target: 'http://192.168.2.182:10001/hottopic',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/home_list": ""
    }
  }))
  app.use(createProxyMiddleware('/collect', {
    target: 'http://192.168.2.182:10001/collection',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/collect": ""
    }
  }))
  //  个人信息页面的修改
  app.use(createProxyMiddleware('/set', {
    target: 'http://192.168.2.185:80',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/set": ""
    }
  }))
  // 详情咨询动态
  app.use(createProxyMiddleware('/detailsDongtai', {
    target: 'http://192.168.2.153:8089',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/detailsDongtai": ""
    }
  }))
  app.use(createProxyMiddleware('/detailsDongtai', {
    target: 'http://192.168.2.153:8089',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/detailsDongtai": ""
    }
  }))
  app.use(createProxyMiddleware('/pinglun', {
    target: 'http://192.168.2.182:10005',
    // secure: false,
    changeOrigin: true,
    pathRewrite: {
      "^/pinglun": ""
    }
  }))
}


